<%@ page 	contentType="text/html; charset=UTF-8" 
		 	import="org.apache.log4j.Logger"
			pageEncoding="UTF-8" 
%>
<%! 
	final static private Logger LOGGER = Logger.getLogger("org.javaongems.server.view.jsp.GwtHosted");
%>

<%
  if (LOGGER.isDebugEnabled()) LOGGER.debug("called gwt-hosted.jsp");

  String ctx = request.getContextPath();
  String ctxWithEndSlash = ctx;
  if (!ctx.endsWith("/"))
	ctxWithEndSlash += "/";
%>
<html>
<body>
<script>
  var $wnd = parent;
  var $doc = $wnd.document;
  var q = location.search.substring(1);
  var i = q.lastIndexOf("=");
  var $moduleName = q;
  var $moduleBaseURL = "<%= ctxWithEndSlash%>" + $moduleName;
  if (i != -1) {
  	$moduleBaseURL = q.substring(0, i);
  	$moduleName = q.substring(i+1);
  }
  parent.__gwt_initHostedModeModule(this, $moduleName);
</script>
</body>
</html>